<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <title>钉钉JS-API demo</title>
    <meta name="description" content="">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="http://g.alicdn.com/ilw/ding/0.2.3/styles/main.css?v=262192719_110744">
</head>
<body>
<script type="text/javascript" src="//g.alicdn.com/alilog/wlog/0.2.10/??aplus_wap.js,spm_wap.js,spmact_wap.js" async
        defer></script>
<script type="text/javascript" id="aplus-sufei" src="//g.alicdn.com/secdev/sufei_data/2.0.4/index.js" async
        defer></script>
<div class="well"><h5 class="badge">钉钉JS-API<span class="caret"></span></h5>
    <button class="btn btn-block btn-default J_method_out_btn" data-method="dd.version" data-param=''
            data-action="alert">钉钉客户端版本
    </button>
    <button class="btn btn-block btn-default J_shake" data-method="device.accelerometer.watchShake"
            data-param='{"sensitivity": 15, "frequency": 150, "callbackDelay": 1000}'>启动摇一摇
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.accelerometer.clearShake">停止摇一摇</button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.vibrate"
            data-param='{"duration": 300}'>震动
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.contact.choose"
            data-param='{"multiple": true, "max": 30}' data-action="alert">选取企业通讯录[无corpId和users]
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.contact.choose"
            data-param='{"multiple": true, "max": 30, "corpId": "dingea786bf7dcce0e0c", "users": []}'
            data-action="alert">选取企业通讯录[有corpId和users]
    </button>
    <button class="btn btn-block btn-default J_nav_left" data-method="biz.navigation.setLeft"
            data-param='{"control": true, "text": "取消"}'>设置左侧导航
    </button>
    <button class="btn btn-block btn-default J_method_btn J_nav_title" data-method="biz.navigation.setTitle"
            data-param='{"title": "邮箱正文"}'>设置标题
    </button>
    <button class="btn btn-block btn-default J_method_btn J_nav_title" data-method="biz.navigation.setTitle"
            data-param='{"title": ""}'>重置标题
    </button>
    <button class="btn btn-block btn-default J_nav_right" data-method="biz.navigation.setRight"
            data-param='{"control": true, "text": "发送"}'>设置右侧导航
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.navigation.setRight"
            data-param='{"show": false}'>隐藏右侧导航
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.navigation.back" data-param='{}'>页面后退
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.alert"
            data-param='{"message": "亲爱的", "title": "提示", "buttonName": "收到"}'>弹窗alert
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.confirm"
            data-param='{"message": "你爱我吗？", "title": "提示", "buttonLabels": ["爱", "不爱"]}' data-action="alert">弹窗confirm
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.prompt"
            data-param='{"message": "再说一遍？", "title": "提示", "buttonLabels": ["继续", "不玩了"]}' data-action="alert">弹窗prompt
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.open"
            data-param='{"name": "chat", "params": {"corpId": "dingea786bf7dcce0e0c", "users": ["14823", "26713232"]}}'>
        打开聊天页面
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.share"
            data-param='{"url": "http://m.laiwang.com", "title": "支付宝新春红包节目单", "content": "新春将至，支付宝现金拜年！每天整点现金大放送，欲知详情，猛戳起来！", "image": "https://i01.lw.aliimg.com/tfs/TB1TUovHXXXXXbCXpXXNC1IYXXXLAIWANGi_1_120_120.jpg"}'>
        分享
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.share"
            data-param='{"type": 0, "url": "http://m.laiwang.com", "title": "支付宝新春红包节目单", "content": "新春将至，支付宝现金拜年！每天整点现金大放送，欲知详情，猛戳起来！", "image": "https://i01.lw.aliimg.com/tfs/TB1TUovHXXXXXbCXpXXNC1IYXXXLAIWANGi_1_120_120.jpg"}'>
        分享(type: 0)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.share"
            data-param='{"type": 1, "url": "http://m.laiwang.com", "title": "支付宝新春红包节目单", "content": "新春将至，支付宝现金拜年！每天整点现金大放送，欲知详情，猛戳起来！", "image": "https://i01.lw.aliimg.com/tfs/TB1TUovHXXXXXbCXpXXNC1IYXXXLAIWANGi_1_120_120.jpg"}'>
        分享(type: 1)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.share"
            data-param='{"type": 2, "url": "http://m.laiwang.com", "title": "支付宝新春红包节目单", "content": "新春将至，支付宝现金拜年！每天整点现金大放送，欲知详情，猛戳起来！", "image": "https://i01.lw.aliimg.com/tfs/TB1TUovHXXXXXbCXpXXNC1IYXXXLAIWANGi_1_120_120.jpg"}'>
        分享(type: 2)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.ut"
            data-param='{"key": "h5_ut_test_demo", "value": "123"}'>UT打点
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.open"
            data-param='{"name": "call", "params": {}}'>钉钉免费电话
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.open"
            data-param='{"name": "profile", "params": {"corpId": "dingea786bf7dcce0e0c", "id": "14823"}}'>打开个人资料页
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.open"
            data-param='{"name": "profile", "params": {"corpId": "dingea786bf7dcce0e0c"}}'>打开个人资料页(无id)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.datepicker"
            data-param='{"format": "yyyy-MM-dd"}' data-action="alert">日期选择器
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.datepicker"
            data-param='{"format": "yyyy-MM-dd", "value": "2015-05-20"}' data-action="alert">日期选择器(有默认值)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.timepicker"
            data-param='{"format": "HH:mm"}' data-action="alert">时间选择器
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.timepicker"
            data-param='{"format": "HH:mm", "value": "08:30"}' data-action="alert">时间选择器(有默认值)
    </button>
    <h5 class="badge" id="J_1">ability: 0.0.1<span class="caret"></span></h5>
    <button class="btn btn-block btn-default J_method_btn" data-method="runtime.info" data-param='{}'
            data-action="alert">容器信息
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.geolocation.get" data-param='{}'
            data-action="alert">获取经纬度
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.toast"
            data-param='{"text": "发送成功"}'>toast
    </button>
    <button class="btn btn-block btn-default J_loading" data-method="device.notification.showPreloader"
            data-param='{"text": "使劲加载中..", "showIcon": true}'>显示loading
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.hidePreloader"
            data-param='{}'>隐藏loading
    </button>
    <button class="btn btn-block btn-default J_upload" data-method="biz.util.uploadImage"
            data-param='{"multiple": false}' data-action="alert">上传图片(单图)
    </button>
    <button class="btn btn-block btn-default J_upload" data-method="biz.util.uploadImage"
            data-param='{"multiple": true}' data-action="alert">上传图片(多图)
    </button>
    <button class="btn btn-block btn-default J_upload" data-method="biz.util.uploadImage"
            data-param='{"multiple": true, "max": 3}' data-action="alert">上传图片(多图, max:3)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.previewImage"
            data-param='{"urls": ["http://gw.alicdn.com/tps/i1/TB12i5PHFXXXXaKXVXXY7J9SpXX-500-699.jpeg", "http://gw.alicdn.com/tps/i4/TB1E4yUHFXXXXboXFXXK0qsSpXX-500-750.jpeg", "http://gw.alicdn.com/tps/i3/TB1Eee0HFXXXXc_XpXXL.KX0VXX-440-586.jpeg", "http://gw.alicdn.com/tps/i2/TB1Nn1THFXXXXbKXFXX_SFfVFXX-658-658.jpeg"], "current": "http://gw.alicdn.com/tps/i4/TB1E4yUHFXXXXboXFXXK0qsSpXX-500-750.jpeg"}'>
        浏览图片
    </button>
    <h5 class="badge" id="J_2">ability: 0.0.2<span class="caret"></span></h5>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.connection.getNetworkType"
            data-param='{}' data-action="alert">网络类型
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.qrcode" data-param='{}'
            data-action="alert">扫码
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.toast"
            data-param='{"global": true, "icon": "success","text": "发送成功", "duration": 2, "delay": 0}'>toast带icon
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.toast"
            data-param='{"global": true, "icon": "error","text": "提交失败", "duration": 2, "delay": 0}'>toast带icon[error]
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.actionSheet"
            data-param='{"title": "谁是最棒哒？", "cancelButton": "取消", "otherButtons": ["孙悟空", "猪八戒", "唐僧", "沙和尚"]}'
            data-action="alert">actionSheet
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.notification.actionSheet"
            data-param='{"cancelButton": "取消", "otherButtons": ["孙悟空", "猪八戒", "唐僧", "沙和尚"]}' data-action="alert">
        actionSheet无title
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="ui.input.plain"
            data-param='{"placeholder": "请输入评论...", "text": "我是默认填充文本"}' data-action="alert">ui.input.plain
    </button>
    <h5 class="badge" id="J_3">ability: 0.0.3<span class="caret"></span></h5>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.ding.post"
            data-param='{"corpId": "dingea786bf7dcce0e0c", "users": ["14823"], "type": 0}'>发钉(无附件钉)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.ding.post"
            data-param='{"corpId": "dingea786bf7dcce0e0c", "users": ["14823"], "type": 1, "attachment": {"images": ["http://gw.alicdn.com/tps/i3/TB1c3slGXXXXXbaaXXX5Oym2XXX-2880-1402.jpg_640x640xz.jpg", "http://gw.alicdn.com/tps/i2/TB1SlYwGFXXXXXrXVXX9vKJ2XXX-2880-1560.jpg_640x640xz.jpg"]}, "text": "图片类型的钉"}'>
        发钉(image)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.ding.post"
            data-param='{"corpId": "dingea786bf7dcce0e0c", "users": ["14823"], "type": 2, "attachment": {"title": "源于关于公司三八节放假通知", "url": "http://m.laiwang.com", "image": "http://gw.alicdn.com/tps/i2/TB1SlYwGFXXXXXrXVXX9vKJ2XXX-2880-1560.jpg_640x640xz.jpg", "text": "放假半天"}, "text": "快说说你们放假想干啥吧"}'>
        发钉(link)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.telephone.call"
            data-param='{"corpId": "dingea786bf7dcce0e0c", "users": ["26713232"]}'>打电话
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.chat.chooseConversation"
            data-param='{"isConfirm":true}' data-action="alert">选群组
    </button>
    <h5 class="badge" id="J_4">ability: 0.0.4<span class="caret"></span></h5>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.open"
            data-param='{"name": "contactAdd", "params": {}}'>拉起联系人添加页面
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.open"
            data-param='{"name": "friendAdd", "params": {}}'>拉起添加好友页面
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.contact.createGroup" data-param='{}'
            data-action="alert">创建企业群聊天[未指定corpId]
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.contact.createGroup"
            data-param='{"corpId": "dingea786bf7dcce0e0c", "users": ["14823", "67388", "26713232"]}'
            data-action="alert">创建企业群聊天[有corpId和users]
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.datetimepicker"
            data-param='{"format": "yyyy-MM-dd HH:mm", "value": "2015-05-15 09:00"}' data-action="alert">日期+时间选择器
    </button>
    <h5 class="badge" id="J_5">ability: 0.0.5<span class="caret"></span></h5>
    <button class="btn btn-block btn-default J_method_btn" data-method="biz.util.chosen"
            data-param='{"source": [{"key": "选项1", "value": 1},{"key": "选项2", "value": 2}]}' data-action="alert">下拉组件
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.base.getUUID" data-param='{}'
            data-action="alert">获取设备唯一识别码UUID
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.base.getInterface" data-param='{}'
            data-action="alert">获取热点接入信息
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.launcher.checkInstalledApps"
            data-param='{"apps": ["sinaweibo", "taobao"]}' data-action="alert">检测是否安装了微博和淘宝(iOS)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.launcher.launchApp"
            data-param='{"app": "taobao"}' data-action="alert">启动淘宝(iOS)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.launcher.checkInstalledApps"
            data-param='{"apps": ["com.sina.weibo", "com.taobao.taobao"]}' data-action="alert">检测是否安装了微博和淘宝(android)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="device.launcher.launchApp"
            data-param='{"app": "com.sina.weibo"}' data-action="alert">启动微博(android)
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="runtime.permission.requestAuthCode"
            data-param='{}' data-action="alert">请求授权码
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="runtime.permission.requestJsApis"
            data-param='{"corpId": "", "timeStamp": "", "nonceStr": "", "signature": "", "jsApiList": []}'
            data-action="alert">请求JSAPI
    </button>
    <button class="btn btn-block btn-default J_pull_to_refresh" data-method="ui.pullToRefresh.enable" data-param='{}'
            data-action="alert">启用下拉刷新
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="ui.pullToRefresh.stop" data-param='{}'
            data-action="alert">收起下拉loading
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="ui.pullToRefresh.disable" data-param='{}'
            data-action="alert">禁用下拉刷新
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="ui.webViewBounce.disable" data-param='{}'
            data-action="alert">禁用webview下拉弹性效果
    </button>
    <button class="btn btn-block btn-default J_method_btn" data-method="ui.webViewBounce.enable" data-param='{}'
            data-action="alert">启用webview下拉弹性效果
    </button>
    <h5 class="badge">系统控件<span class="caret"></span></h5> <h5>日期</h5> <input class="plain" type="date"
                                                                              value="2015-02-10"> <h5>时间</h5> <input
            class="plain" type="time" value="14:58"> <h5>日期和时间</h5> <input class="plain" type="datetime-local"
                                                                           value="2015-02-10T14:58"> <h5>下拉菜单</h5>
    <select class="plain">
        <option value="0">请选择请假类型</option>
        <option value="1">年休假</option>
        <option value="2">路途假</option>
        <option value="3">婚假</option>
    </select> <h5>文件</h5> <input class="plain J_file" data-type="create" type="file" value=""> <h5>电话号码</h5> <input
            class="plain" type="tel" value=""></div>
<ul class="list-group" id="J_console"></ul>
<button class="btn btn-block btn-default J_clear">清除日志</button>
<script src="http://g.alicdn.com/ilw/ding/0.1.2/scripts/vendor.js?v=2976120725_91987"></script>
<script>window.onerror = function () {
    var a = Array.prototype.slice.call(arguments);
    console.log("JS报错：", a)
};
$(function () {
    FastClick.attach(document.body)
});
var log = function () {
    var a = [].slice.call(arguments);
    a = a.map(function (d) {
        if (typeof d === "object") {
            return JSON.stringify(d)
        } else {
            return d
        }
    });
    var c = $('<li class="list-group-item" />');
    var b = a.join("  ");
    c.text(b);
    $("#J_console").append(c)
};
console.log = log;
$(".J_clear").on("click", function () {
    $("#J_console").empty()
});</script>
<script src="http://g.alicdn.com/ilw/ding/0.3.8/scripts/dingtalk.js?v=2697369616_6771"></script>
<script src="http://g.alicdn.com/ilw/ding/0.2.7/scripts/demo.js?v=2599836234_12346"></script>
<script></script>
</body>
</html>